import java.util.Scanner;

public class eg2_6 {
    public static void main(String[] args) {
        Scanner sin=new Scanner(System.in);
        double num1;
        double num2;
        char sign;
        double result=0;
        System.out.println("请输入一个数：");
        num1= sin.nextDouble();
        System.out.println("请输入一个数：");
        num2= sin.nextDouble();
        System.out.println("请输入一个运算符（+，-，*，/）:");
        sign =sin.next().charAt(0);
        switch (sign){
            case '+':
                result=num1+num2;
                break;
            case '-':
                result=num1-num2;
                break;
            case '*':
                result=num1*num2;
                break;
            case '/':
                result=num1/num2;
                break;
        }
        System.out.println("运算结果是："+result);
    }
}
